package com.youhome.common.enums;

/**
 * Created by chen365 on 2019/05/28.
 */
public enum ZilLowSearchTypeEnum {

    ZIP(1, "邮编"),
    STATE(2, "州"),
    STATE_CITY(3, "州_城市"),
    STATE_CITY_COUNTY(4, "州_城市_郡县");


    private Integer key;
    private String description;

    ZilLowSearchTypeEnum(Integer key, String description) {
        this.key = key;
        this.description = description;
    }

    //根据key获取枚举
    public static ZilLowSearchTypeEnum getEnumByKey(Integer key) {
        if (null == key) {
            return null;
        }
        for (ZilLowSearchTypeEnum temp : ZilLowSearchTypeEnum.values()) {
            if (temp.getKey().equals(key)) {
                return temp;
            }
        }
        return null;
    }

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
